﻿#nullable disable

using NewRetail.Application.Core.Entity;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace NewRetail.Application.Components.StoreValueCard.Entity
{
    /// <summary>
    /// 储值卡充值记录表
    /// </summary>
    public class CardRechargeRecordEntity : BaseEntity
    {
        /// <summary>
        /// 充值日期
        /// </summary>
        [Required]
        [MaxLength(15)]
        public string rechargeDate { get; set; }
        /// <summary>
        /// 商户订单号
        /// </summary>
        [Required]
        [MaxLength(35)]
        public string outTradeNumber { get; set; }
        /// <summary>
        /// 充值时间
        /// </summary>
        [Required]
        [MaxLength(30)]
        public string rechargeDateTime { get; set; }
        /// <summary>
        /// openid
        /// </summary>
        [MaxLength(50)]
        public string openId { get; set; }
        /// <summary>
        /// 会员号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string memberNo { get; set; }
        /// <summary>
        /// 会员Id
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string memberId { get; set; }
        /// <summary>
        /// 充值金额，单位：分。
        /// </summary>
        public int rechargeAmount { get; set; }
        /// <summary>
        /// 赠送金额，单位：分。
        /// </summary>
        public int giftAmount { get; set; }
        /// <summary>
        /// 订单状态  状态枚举值：对应枚举类 OrderStatus
        /// </summary>
        public int rechargeStatus { get; set; }
        ///// <summary>
        ///// 来源类型(1:储值卡充值/退款   2:储值卡支付)
        ///// </summary>
        //[Required]
        //public int sourceType { get; set; }
        /// <summary>
        /// 支付方式(1:微信支付   2:支付宝支付  3:线下支付)
        /// </summary>
        [Required]
        public int payWay { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string? remark { get; set; }
    }

    public enum EnumOrderStatus
    {
        [Description("支付成功")]
        SUCCESS = 0,
        [Description("转入退款")]
        REFUND = 1,
        [Description("未支付")]
        NOTPAY = 2,
        [Description("已关闭")]
        CLOSED = 3,
        [Description("已撤销")]
        REVOKED = 4,//仅付款码支付会返回
        [Description("用户支付中")]
        USERPAYING = 5,//仅付款码支付会返回
        [Description("支付失败")]
        PAYERROR = 6//仅付款码支付会返回

    }
}
